/*
 * $Id: RequestListDUI.java,v 1.4 2009/12/14 20:29:03 oliver Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

package com.ge.healthcare.autosc.ui.dao;

import com.ge.healthcare.autosc.common.ASCUtil;
import com.ge.healthcare.autosc.ui.pojo.UiRequestList;

public class RequestListDUI extends BaseDaoUI {
	public static UserInterfaceDAO uiDAO;

	public static UiRequestList getRequestList(String rqListId) {
		UiRequestList requestList;
		try {
			rqListId = cleanupInputString(rqListId);
			requestList = uiDAO.getRequestList(rqListId);
			if (ASCUtil.isNullOrEmptyObject(requestList)
					|| ASCUtil.isNullOrEmptyObject(requestList
							.getRequestListId())) {
				String msg = "No File Records for Request List Id: " + rqListId;
				throw new RuntimeException(msg);
			}
		} catch (Exception e) {
			requestList = new UiRequestList();
			setErrorMessage(requestList, e);
		}
		return requestList;
	}

	public void setUiDAO(UserInterfaceDAO uiDAO) {
		RequestListDUI.uiDAO = uiDAO;
	}
}
